In order to prevent communication data in a communication network from being eavesdropped or altered by illegals, in a wireless network, a passive optical network or a power line communication network, even in a wired network, researchers commonly adopt a key to protect security of the communication data, ensure confidentiality of the communication data by protection, and ensure integrality of data by calculating an integrity check value. It is necessary for both a sender and a receiver of the data to know the key in those mechanisms for protecting the security of the data.
In order to prevent the key from being obtained by an illegal user by analyzing the intercepted data and thus prevent the communication data from being obtained or altered, it is necessary to update the key frequently. There are many ways to update the key. However, many key update mechanisms solves only the problem about how the two sides of communication obtain a new key, but do not concern the problem about how the sender and the receiver switch between the original key and the new key. Generally, the two sides of communication switch to the new key at different time instants. Once switching is conducted improperly, the receiver may be unable to de-protect data sent by the sender.